# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-mako
pkgver=1.1.5
pkgrel=1
pkgdesc="A super-fast templating language that borrows the best ideas from the existing templating languages"
arch=('any')
url="https://www.makotemplates.org/"
license=('MIT')
depends=('python-markupsafe' 'python-beaker' 'python-setuptools')
checkdepends=('python-pytest' 'python-mock' 'python-babel' 'python-pygments'
              'python-dogpile.cache')
source=("https://pypi.io/packages/source/M/Mako/Mako-$pkgver.tar.gz"{,.asc})
sha512sums=('3eff75f1a94f8e01131ce118df73be1ade79306562ae2ca68079eb2b64ef82c48c09cfd7ed6eda42819bf50c70941cf4115f8918b4d8187f7489717c7d4a423b'
            'SKIP')
validpgpkeys=('83AF7ACE251C13E6BB7DEFBD330239C1C4DAFEE1')  # Michael Bayer

prepare() {
  cd Mako-$pkgver
  sed -e '/\[tool:pytest\]/a filterwarnings =\n    error\n    ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning' \
      -e 's/-W error//' \
      -i setup.cfg
}

build() {
  cd Mako-$pkgver
  python setup.py build
}

check() {
  cd Mako-$pkgver
  python -m pytest
}

package() {
  cd Mako-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
